﻿Imports System
Imports System.Collections.ObjectModel
Imports System.Workflow.ComponentModel
Imports System.Workflow.ComponentModel.Design

Namespace System.Workflow.Activities
    Friend NotInheritable Class ReplicatorDesigner
        Inherits SequenceDesigner
        ' Methods
        Public Overrides Function CanInsertActivities(ByVal insertLocation As HitTestInfo, ByVal activitiesToInsert As ReadOnlyCollection([Of] Activity)) As Boolean
            Dim activity As CompositeActivity = [TryCast](MyBase.Activity,CompositeActivity)
            If ((Not activity Is Nothing) AndAlso (activity.EnabledActivities.Count > 0)) Then
                Return False
            End If
            If (activitiesToInsert.Count > 1) Then
                Return False
            End If
            Return MyBase.CanInsertActivities(insertLocation, activitiesToInsert)
        End Function

    End Class
End Namespace

